package 补充.输入输出操作.字节流;

import java.io.*;

public class 字节流缓冲区 {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("D:\\Learn\\javademo\\untitled\\src\\补充_偏\\输入输出操作\\read.txt");
        FileOutputStream fos = new  FileOutputStream("D:\\Learn\\javademo\\untitled\\tar\\read.txt");
        byte[] b = new byte[1024];
        int len;
        long begin = System.currentTimeMillis();
        while ((len=fis.read(b))!=-1){
            fos.write(b,0,len);
        }
        long end = System.currentTimeMillis();
        System.out.println("复制文件耗时"+(end - begin));
        fis.close();
        fos.close();
    }
}
